import request from '@/utils/request.js';
// 注册
export const registerApi = (data) => {
  return request({
    method: 'post',
    url: '/api/reg',
    data
  });
};
// 登录
export const loginApi = (data) => {
  return request({
    method: 'post',
    url: '/api/login',
    data
  });
};
// 获取用户基本信息
export const userInfoApi = () => {
  return request({
    url: '/my/userinfo'
  });
};
// 修改用户信息
export const updateUserInfoApi = (data) => {
  return request({
    method: 'put',
    url: '/my/userinfo',
    data
  });
};
// 更新用户头像
export const updateUserAvatarApi = (data) => {
  return request({
    method: 'post',
    url: '/my/update/avatar',
    data
  });
};
// 更新用户密码
export const updateUserPasswordApi = (data) => {
  return request({
    method: 'post',
    url: '/my/updatepwd',
    data
  });
};
